home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group03a.txt / 000019_icon-group-sender_Thu Feb 20 13:31:58 2003.msg < prev    next >
Internet Message Format  |  2003-12-22  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h1KKSwc05373
  4.     for icon-group-addresses; Thu, 20 Feb 2003 13:28:58 -0700 (MST)
  5. Message-Id: <200302202028.h1KKSwc05373@baskerville.CS.Arizona.EDU>
  6. From: Patrick Scheible <kkt@itchy.serv.net>
  7. X-Newsgroups: comp.lang.icon
  8. Subject: Re: Simplifying Integer Arithmetic
  9. Date: 20 Feb 2003 17:28:32 GMT
  10. X-Newsreader: Gnus v5.3/Emacs 19.34
  11. To: icon-group@cs.arizona.edu
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14.  
  15. "Frank J. Lhota" <NOSPAM.lhota.adarose@verizon.net> writes:
  16.  
  17. > The question I pose to this group is whether we should assume that any C
  18. > compiler used for Icon uses the "round towards 0" method for evaluating a /
  19. > b and a % b for integers a and b. Given this assumption, we could simplify
  20. > the div3 and mod3 functions in "runtime/rmisc.r" as follows:
  21.  
  22. I would suggest not making any assumptions about which C compilers
  23. people may use at some point, especially since the work of making Icon
  24. round towards 0 regardless of the C compiler's behavior has already
  25. been done.  Who knows what strange platforms someone may wish to port
  26. Icon to at some point?
  27.  
  28. However, I have not done a survey of whether there are any C compilers
  29. that do not round towards 0.  (Maybe the nice people in comp.lang.c
  30. happen to know?)
  31.  
  32. -- Patrick
  33.  
  34.